﻿﻿/*加载分页工具条
 * 
 * total 总计录数
 * currentpage 当前页
 * size 每页显示条目数
 * visibPage 工具条显示几页
 * page 跳转页面
 * 
 */
function pagination(option,param){
	totalPages=option.total%option.size>0?option.total/option.size+1:option.total/option.size;
	if(option.visibPage>totalPages)
		option.visibPage=totalPages;
	return {
        totalPages: totalPages,
        pageSize:option.size,
        visiblePages: option.visibPage,
        currentPage: option.currentpage,
        first:'<li class="first"><a href="javascript:;">首页</a></li>',
        prev:'<li class="prev"><a href="javascript:;"><i class="arrow arrow2"></i>上一页</a></li>',
        next:'<li class="next"><a href="javascript:;">下一页<i class="arrow arrow3"></i></a></li>',
        last:'<li class="last"><a href="javascript:;">末页</a></li>',
        page:'<li class="page"><a href="javascript:;">{{page}}</a></li>',
        onPageChange: function (num, type) {
        	//type init change
			if (type === "change") {
				if(!param)
					param={};
				param.page=num-1;
				param.size=10;
				$("#frameReft").load(option.pagePath, param);
			}
        }
    };

}